[class*='language-'] {
  font-family: var(--vxp-font-family-mono);
  font-size: var(--vxp-font-size-base);
  hyphens: none;
  line-height: calc(var(--vxp-font-size-base) * 2);
  color: var(--vxp-content-color-base);
  text-align: left;
  word-break: normal;
  word-wrap: normal;
  tab-size: 2;
  white-space: pre;
  direction: ltr;
  background-color: transparent;
  word-spacing: normal;

  &::selection,
  ::selection {
    text-shadow: none;
    background-color: var(--vxp-color-info-opacity-2);
  }
}

div[class*='language-'] {
  position: relative;
  background-color: var(--vxp-fill-color-background);
  border-radius: var(--vxp-radius-large);
}

pre[class*='language-'] {
  padding: 12px 20px;
  padding-inline-start: 56px;
  margin: 0;
  overflow-x: auto;
}

.code-line-numbers {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 56px;
  text-align: center;
  letter-spacing: -0.5px;
  pointer-events: none;
  counter-reset: code-line-number;
  user-select: none;

  & > span {
    display: block;
    font-size: 13px;
    color: var(--vxp-content-color-disabled);
    counter-increment: code-line-number;

    &::before {
      content: counter(code-line-number);
    }
  }
}

@media print {
  code[class*='language-'],
  pre[class*='language-'] {
    text-shadow: none;
  }
}

/* Inline code */
:not(pre) > code[class*='language-'] {
  padding: 0.1em;
  white-space: normal;
  border-radius: 4px;
}

.token {
  &.comment,
  &.prolog,
  &.doctype,
  &.cdata {
    color: var(--vxp-content-color-third);
  }

  &.punctuation {
    color: #999;
  }

  // &.namespace {
  //   opacity: 1;
  // }

  &.property {
    color: var(--vxp-color-warning-dark-2);
  }

  &.tag,
  &.boolean,
  &.number,
  &.constant,
  &.symbol,
  &.deleted {
    color: var(--vxp-color-error-base);
  }

  &.attr-name {
    color: #d141f5;
  }

  &.selector,
  &.string,
  &.char,
  &.builtin,
  &.inserted,
  &.attr-value {
    color: var(--vxp-color-success-dark-2);
  }

  &.operator,
  &.entity,
  &.url {
    color: #9a6e3a;
  }

  &.atrule,
  &.keyword {
    color: var(--vxp-color-primary-base);
  }

  &.function,
  &.class-name {
    color: var(--vxp-color-error-base);
  }

  &.regex,
  &.important,
  &.variable {
    color: #e90;
  }

  &.important,
  &.bold {
    font-weight: bold;
  }

  &.italic {
    font-style: italic;
  }

  &.entity {
    cursor: help;
  }
}

.language-css .token.string,
.style .token.string {
  color: #9a6e3a;
}

.token.keyword {
  &-const,
  &-let,
  &-var,
  &-async {
    color: #d141f5;
  }
}
